import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { TradeService } from './trade.service';
import { CreateTradeDto } from './dto/create-trade.dto';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { Public } from '../auth/decorators/public.decorator';

@ApiBearerAuth()
@ApiTags('成交记录')
@Controller('trade')
export class TradeController {
  constructor(private readonly tradeService: TradeService) {}

  // 新增、修改
  @Post('add')
  @ApiOperation({ summary: '新增、修改', description: '新增、修改' })
  create(@Body() createTradeDto: CreateTradeDto) {
    return 1;
    // return this.userService.create(createUserDto);
  }

  @Public()
  @Get('list')
  @ApiOperation({ summary: '成交列表' })
  async list(@Query() params: any) {
    console.log('成交列表');
    return this.tradeService.findAll(params);
  }
}
